package router

import (
	"api-gateway/basic/config"
	"api-gateway/handler/api"
	"github.com/gin-gonic/gin"
	"github.com/share309/gojwt"
)

func Router(r *gin.Engine) {
	v1 := r.Group("/v1")
	{
		user := v1.Group("/user")
		{
			user.POST("/sendSms", api.SendSms)
			user.POST("/login", api.LoginUser)
		}
		activity := v1.Group("/activity")
		{
			activity.POST("/addActivity", api.AddActivity)
		}
		order := v1.Group("/order")
		{
			order.POST("/payOrder", api.PayOrder)
			r.Use(gojwt.JWTAuth(config.JWT_KEY))
			order.POST("/createOrder", api.CreateOrder)
		}
	}
}
